(function ($) {
	/**
	 * AjaxSolr.ManualBoostWidget displays the geo-pos of the search result on a google-maps map.
	 * Requires http://maps.googleapis.com/maps/api/js and jQuery
	 */
	AjaxSolr.ManualBoostWidget = AjaxSolr.AbstractWidget.extend({
		target: null,
		field: 'q',
		afterRequest: function() {
			var target = $(this.target).empty();
			
			var query = this.manager.store.values(this.field);
			var words = [];
			for (i in query) {
				words = words.concat(this.tokenize(query[i]));
			}

			for (i in words) {
				var w = words[i];
				var r = this.resultFor(w);
				if (r) {
					target.append($(r));
				}
			}
		},
		resultFor: function(qWord) {
			throw new Exeption("abstract method");
		},
		tokenize: function(query) {
			return query.split(/[ ]+/);
		}
	});
})(jQuery);